fixed arrayindexoutofbounds in getThumbnailWidth

thanks to andreas burger for reporting the bug