DAM-305: Improve thumbnail creation