Handle image resizing in controller (should be moved to a specific class
later)