Properly get image width and heaight

The previous implementation had an error in its conditional, making it always default to an 150x150px image (the thumbnail defaults). This was due to a reversed conditional.