feature #2435: Remove unused function. Minor optimizations

(cherry picked from commit eb56f526a69a675730f265ee2488617dfa05b171)
feature #2435: PUBLIC_CLOUD is not case sensitive

(cherry picked from commit a385eb773c80701ea84745545e67e14c8df150c3)
feature #2489: Size must be set for SOURCE based images

(cherry picked from commit cd177e6ab0566641a0e8810ed5947cc9c2ddcdeb)
(cherry picked from commit 6f979c970d2a52d5b0389f9484bb7b41b56ea6c2)