Q:

iOS: Use UIImage in ViewModel(from MVVM) and in Presenter(from MVP)

I'm trying to figure out in MVVM and MVP architecture designs. I've decided to write simple one screen application with different design approaches.
Few words about sample application:

It's a simple image loader
Flow: Loads JSON with pictures from 500px -> Shows cells in UICollectionView depends on count pictures in returned JSON -> Gradually downloads pictures and displays it in cells
The same applications I'm implementing under 3 architecture designs MVVM, MVC and MVP

Everything was going smoothly until I've needed to download images and display them  . 
Initially I've though that the best place for handling this logic and caching pictures is ViewModel(from MVVM) and in Presenter(from MVP) but AFAIK these two entities should be independent from UI layer, but if we want to use UIImage there it means that we should import UIKit in ViewModel/Presenter 
So, questions

Can I use import UIKit in ViewModel/Presenter?
What is the best place for Load&Store UIImage in this UIViewController,
ViewModel/Presenter or something else?

GitHub link on sample application
 

A:

Instead of working with UIImage objects why not use the image Data? That way you do your caching and logic working with the Data and then convert to UIImage objects when you need to. So the only time you work with UIImage will be in the UIViewController converting the Data to UIImage.

