Adding code to resize image according to display size/type