Add nil check on total image size calculation
Add nil check on total image size calculation

Acidburn0zzz/imagelayers,patocox/imagelayers,BWITS/imagelayers,CenturyLinkLabs/imagelayers,rupakg/imagelayers,Acidburn0zzz/imagelayers,rupakg/imagelayers,argvader/imagelayers,CenturyLinkLabs/imagelayers,argvader/imagelayers,patocox/imagelayers,BWITS/imagelayers