fix after merge for ' char and added check before retrieval of image size