Switch to a library for better image handling