fixing issues when the image does not fill the whole allocated