Fixed bug in small image creation