Added error check for thumbnail dimension retrieval