Added logic to prevent the width and height values of the original image from being overwritten. These values are used later if the user wants to maintain the aspect ratio of the original image