Check if size is set

Fixes 'Undefined index: size' when size is not set (on a directory for example)