set the image size CSS props dynamically via JS based on its height vs width