Image resize with retaining aspect ratio using imagine library